#define _CRT_SECURE_NO_WARNINGS 1
#define DEFAULT_CAPACITY 3
#define INC_SIZE 2

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<windows.h>

struct PeoInfo
{
	char name[10];
	int age;
	char gender[6];
	char number[12];
};

typedef struct PeoInfo PeoInfo;

struct AddressBook
{
	PeoInfo* data;
	int size;
	int capacity;
};

typedef struct AddressBook AddressBook;

enum CHOOSE
{
	EXIT,
	ADD,
	DEL,
	SEARCH,
	MODIFY,
	SHOW,
	SORT
};

int InitialAddressBook(AddressBook* p);  //Initialize the address book

void display();  //dispaly the lobby for user to choose

void addInfo(AddressBook* p);  //add information to address book

void delInfo(AddressBook* p);  //delet information  from address book

void searchInfo(AddressBook* p);  //serch information storaged in the address book
  
void modifyInfo(AddressBook* p);  //modify information storaged int the address book

void showInfo(AddressBook* p);  //show all information storaged int the address book

void sortByAgeInfo(AddressBook* p);  //sort the information storaged in the address book by age

void saveData(AddressBook* p);  //save data to BIN doucument;

void freeMemory(AddressBook* p);   //free the memory


